package com.xur.springboot.controller;

import com.xur.springboot.entity.Companies;
import com.xur.springboot.entity.CompanyDetails;
import com.xur.springboot.service.CompaniesService;
import com.xur.springboot.service.CompanyDetailsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CompanyDetailsController {

    @Resource
    private CompanyDetailsService CompanyDetailsService;
    //在鸿蒙前端获取数据时需要解析JSON数据
    //直接返回json数据
    @GetMapping("/queryCompanyDetails")
    public List<CompanyDetails> companies(){
        System.out.println("查询了公司信息列表");
        return CompanyDetailsService.queryCompanyDetails();

    }


    //根据com_id查询公司的招聘信息列表
    @GetMapping("/queryHCByCom_id")
    public List<CompanyDetails> queryHCByCom_id(@RequestParam int com_id){
        System.out.println("根据com_id查询了公司招聘信息列表,com_id:" + com_id);
        return CompanyDetailsService.queryHCByCom_id(com_id);

    }

}
